/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.applicatioN.entities;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Slim
 */
@Entity
@Table(name = "exiger_3")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Exiger3.findAll", query = "SELECT e FROM Exiger3 e"),
    @NamedQuery(name = "Exiger3.findByScore", query = "SELECT e FROM Exiger3 e WHERE e.score = :score"),
    @NamedQuery(name = "Exiger3.findByOrganisme", query = "SELECT e FROM Exiger3 e WHERE e.exiger3PK.organisme = :organisme"),
    @NamedQuery(name = "Exiger3.findByDomaineDExpertise", query = "SELECT e FROM Exiger3 e WHERE e.exiger3PK.domaineDExpertise = :domaineDExpertise"),
    @NamedQuery(name = "Exiger3.findByPoste", query = "SELECT e FROM Exiger3 e WHERE e.poste = :poste"),
    @NamedQuery(name = "Exiger3.findByNomPoste", query = "SELECT e FROM Exiger3 e WHERE e.exiger3PK.nomPoste = :nomPoste")})
public class Exiger3 implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected Exiger3PK exiger3PK;
    @Column(name = "SCORE")
    private Integer score;
    @JoinColumns({
        @JoinColumn(name = "ORGANISME", referencedColumnName = "ORGANISME", insertable = false, updatable = false),
        @JoinColumn(name = "DOMAINE_D_EXPERTISE", referencedColumnName = "DOMAINE_D_EXPERTISE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Certification certification;
    @JoinColumn(name = "NOM_POSTE", referencedColumnName = "NOM_POSTE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Poste poste;

    public Exiger3() {
    }

    public Exiger3(Exiger3PK exiger3PK) {
        this.exiger3PK = exiger3PK;
    }

    public Exiger3(String organisme, String domaineDExpertise, String nomPoste) {
        this.exiger3PK = new Exiger3PK(organisme, domaineDExpertise, nomPoste);
    }

    public Exiger3PK getExiger3PK() {
        return exiger3PK;
    }

    public void setExiger3PK(Exiger3PK exiger3PK) {
        this.exiger3PK = exiger3PK;
    }

    public Integer getScore() {
        return score;
    }

    public void setScore(Integer score) {
        this.score = score;
    }

    public Certification getCertification() {
        return certification;
    }

    public void setCertification(Certification certification) {
        this.certification = certification;
    }

    public Poste getPoste() {
        return poste;
    }

    public void setPoste(Poste poste) {
        this.poste = poste;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (exiger3PK != null ? exiger3PK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Exiger3)) {
            return false;
        }
        Exiger3 other = (Exiger3) object;
        if ((this.exiger3PK == null && other.exiger3PK != null) || (this.exiger3PK != null && !this.exiger3PK.equals(other.exiger3PK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.applicatioN.entities.Exiger3[ exiger3PK=" + exiger3PK + " ]";
    }
}
